package com.example.volunteer.mapper;


import com.example.volunteer.model.Skill;
import com.example.volunteer.model.Volunteer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper
public interface VolunteerMapper {
    void insert(Volunteer volunteer);
    void update(Volunteer volunteer);
    void delete(String volunteerId);
    Volunteer findById(String volunteerId);
    Volunteer findByEmail(String email);

    List<Skill> findSkillsByVolunteerId(String volunteerId);

    List<Volunteer> findVolunteersWithPage(@Param("offset") int offset, @Param("pageSize") int pageSize);
    int countVolunteers();

    List<Volunteer> findByIdWithPage(@Param("volunteerId") String volunteerId, @Param("offset") int offset, @Param("pageSize") int pageSize);
    int countById(@Param("volunteerId") String volunteerId);

    List<Volunteer> findByNameWithPage(@Param("name") String name, @Param("offset") int offset, @Param("pageSize") int pageSize);
    int countByName(@Param("name") String name);

    List<Volunteer> findByEmailWithPage(@Param("email") String email, @Param("offset") int offset, @Param("pageSize") int pageSize);
    int countByEmail(@Param("email") String email);

    List<Volunteer> findByContactWithPage(@Param("contact") String contact, @Param("offset") int offset, @Param("pageSize") int pageSize);
    int countByContact(@Param("contact") String contact);
}
